/**
 * Copyright © 2011 Creativor Studio.
 * About license information, please see LICENSE.txt.
 */
package org.creativor.rayson.api;

import java.io.IOException;

/**
 * Interface of one stream based service.
 * 
 * @param <T>
 *            Transfer argument type.
 * @author Nick Zhang
 */
public interface TransferService<T extends TransferArgument>
{
	/**
	 * Process the stream based service.
	 * 
	 * @param argument
	 *            The argument of this transfer call.
	 * @param socket
	 *            Transfer socket object associated with this transfer call.
	 * @throws IOException
	 *             If any IO exception occurred.
	 */
	public void process(T argument, TransferSocket socket) throws IOException;
	
	/**
	 * Check whether the client version is supported by this service.
	 * 
	 * @param clientVersion
	 *            Version number of the client.
	 * @return True is the client version is supported by this service.
	 */
	public boolean isSupportedVersion(short clientVersion);
	
}
